package com.liveinstars.common.ticker;

/**
 * Created by guoyanjiang on 2019-04-03.
 */
public class BaseExchangePair {

    private String exchangeKey;

    private String pair;

    private BasePair basePair;

    public BaseExchangePair(String exchangeKey, String pair) {
        this.exchangeKey = exchangeKey;
        this.pair = pair;
        this.basePair = new BasePair(pair);
    }

    public BaseExchangePair(String exchangeKey, BasePair basePair) {
        this.exchangeKey = exchangeKey;
        this.basePair = basePair;
        this.pair = basePair.providePairStr();
    }

    public String getExchangeKey() {
        return exchangeKey;
    }

    public String getPair(){
        return pair;
    }

    //提供用于在ticker中获取信息的exchangeKey
    public String provideTickerExchangeKey(){
        return exchangeKey;
    }

    //提供用于在ticker中获取信息的pair
    public String provideTickerPair() {
        return pair;
    }

    //提供用于在ticker中获取信息的currency
    public String provideTickerCurrency(){
        return provideCoinCurrencyUnitInPair();
    }

    public String provideCoinSymbolInPair(){
        return basePair.getSymbol();
    }

    public String provideCoinCurrencyUnitInPair(){
        return basePair.getCurrencyUnit();
    }

}
